<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>销售主页</title>
    <script src="js/jquery-3.6.3.min.js"></script>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/bootstrap-theme.css">
    <script src="js/bootstrap.js"></script>
    <script>

        $(function (){
            var reg = /^(0|[1-9][0-9]*)$/
            let user = null;
            $.ajax({
                    url: "/seller/info",
                    type: "get",
                    success: function (data) {
                        let r = data;
                        if (r.code === 1) {
                            user = r.data
                            $("#id").text(user.id)
                            $("#name").val(user.name)
                            $("#address").val(user.address)
                            alert("欢迎登录本商城！")
                        } else {
                            alert(r.msg)
                            window.location.href="/backend/adminLogin.html"
                        }
                    }
                }
            )

            function count(){
                $.ajax({
                        url: "/user/count",
                        type: "get",
                        success: function (data) {
                            let r = data;
                            if (r.code === 1) {
                                $("#count").text("当前在线人数："+r.data)
                            } else {
                                alert(r.msg)
                            }
                        }
                    }
                )
            }

            count()

            function logout(){
                $.ajax({
                        url: "/seller/logout",
                        type: "post",
                        success: function (data) {
                            let r = data;
                            if (r.code === 1) {
                                alert(r.data)
                                window.location.href="/backend/adminLogin.html"
                            } else {
                                alert(r.msg)
                            }
                        }
                    }
                )
            }

            $("#btnCount").click(
                function (){
                    count()
                }
            )

            $("#btnLogout").click(
                function () {
                    logout()
                }
            )

            $("#btnUpdate").click(
                function (){
                    $.ajax({
                            url: "/seller/update",
                            type: "post",
                            data: JSON.stringify({
                                "id": user.id,
                                "name": $("#name").val(),
                                "address": $("#address").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    user=r.data
                                    $("#name").val(user.name)
                                    $("#address").val(user.address)
                                    alert("修改成功")
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("#btnNewSeller").click(
                function (){
                    $.ajax({
                            url: "/seller/newSeller",
                            type: "post",
                            data: JSON.stringify({
                                "id": $("#sellerId").val(),
                                "pwd": $("#sellerPwd").val(),
                                "name": $("#sellerName").val(),
                                "address": $("#sellerAddress").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    alert(r.data)
                                    $("#createSeller").hide()
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("#btnShowNew").click(
                function (){
                    $(".headMenu").find("li").removeClass("active")
                    $(this).parent().addClass("active")
                    $("#infoBox").hide()
                    $("#sellerBox").hide()
                    $("#createSeller").show()
                    $("#userBox").hide()
                    $("#searchBox").hide()
                }
            )

            //销售员分页
            let pages = 1
            let current = 0
            let sellers = null
            let seller = null

            function setBtn(){
                $(".btnSellerDetail").each(function () {
                    $(this).click(
                        function () {
                            seller = $(this).attr("value")
                            window.localStorage.setItem("seller", $(this).attr("value"))
                            window.location.href = "/backend/adminMainDetails.html"
                        }
                    )
                })

                $(".btnRemoveSeller").each(function () {
                    $(this).click(
                        function () {
                            seller = $(this).attr("value")
                            $.ajax({
                                    url: "/seller/remove",
                                    type: "post",
                                    data: JSON.stringify({
                                        "id": seller
                                    }),
                                    contentType: "application/json",
                                    dataType: "json",
                                    success: function (data) {
                                        let r = data;
                                        if (r.code === 1) {
                                            getPage(1)
                                            alert(r.data)
                                        } else {
                                            alert(r.msg)
                                        }
                                    }
                                }
                            )
                        }
                    )
                })

                $(".btnUpdateSeller").each(function () {
                    $(this).click(
                        function () {
                            seller = $(this).attr("value")
                            let trBlock = $("#"+seller)
                            $.ajax({
                                    url: "/seller/update",
                                    type: "post",
                                    data: JSON.stringify({
                                        "id": seller,
                                        "pwd": trBlock.find(".pwd").val(),
                                        "name": trBlock.find(".name").val(),
                                        "address": trBlock.find(".address").val()
                                    }),
                                    contentType: "application/json",
                                    dataType: "json",
                                    success: function (data) {
                                        let r = data;
                                        if (r.code === 1) {
                                            alert("修改成功")
                                        } else {
                                            alert(r.msg)
                                        }
                                    }
                                }
                            )
                        }
                    )
                })
            }

            function getPage(pageNum){

                if(pageNum<=0||pageNum>pages){
                    return
                }

                let table = $("#sellerTable")
                table.empty()
                sellers = null

                $.ajax({
                        url: "/seller/page",
                        type: "post",
                        data: JSON.stringify({
                            "pageNum": pageNum,
                        }),
                        contentType: "application/json",
                        dataType: "json",
                        success: function (data) {
                            let r = data;
                            if (r.code === 1) {

                                pages = r.data.pages
                                $("#pageNum").attr("max", pages)

                                current = r.data.current
                                if(pages<=0){
                                    current=0
                                }

                                $("#pageNum").val(current)

                                sellers = r.data.records
                                if(current<=1){
                                    $("#btnLast").parent("li").addClass("disabled")
                                }
                                else{
                                    $("#btnLast").parent("li").removeClass("disabled")
                                }

                                if(current>=pages){
                                    $("#btnNext").parent("li").addClass("disabled")
                                }
                                else{
                                    $("#btnNext").parent("li").removeClass("disabled")
                                }

                                for (let i = 0; i < sellers.length; i++) {
                                    let seller = sellers[i]

                                    table.append(
                                        "<tr id='" + seller.id+ "'>"+
                                        "<td><label class='id'>" + seller.id + "<label/></td>"+
                                        "<td><input class='pwd' type='text' placeholder='未修改'></td>" +
                                        "<td><input class='name' type='text' value='" + seller.name +"'></td>" +
                                        "<td><input class='address' type='text' value='" + seller.address +"'></td>" +
                                        "<td>" +
                                        "<button class='btnUpdateSeller btn-primary' value='" + seller.id + "'>修改</button>" +
                                        "<button class='btnRemoveSeller btn-danger' value='" + seller.id + "'>移除</button>" +
                                        "<button class='btnSellerDetail btn-info' value='" + seller.id + "'>查看商店</button>" +
                                        "</td>"+
                                        "</tr>"
                                    )
                                }

                                setBtn()

                                $("#labelPage").text("     共 "+pages+" 页，当前第 "+current+" 页，跳转到")
                            } else {
                                alert(r.msg)
                            }
                        }
                    }
                )
            }

            $("#btnShow").click(
                function (){
                    $(".headMenu").find("li").removeClass("active")
                    $(this).parent().addClass("active")
                    if(pages==0){
                        pages=1
                    }
                    getPage(1)
                    $("#infoBox").hide()
                    $("#sellerBox").show()
                    $("#createSeller").hide()
                    $("#userBox").hide()
                    $("#searchBox").hide()
                }
            )

            $("#btnLast").click(
                function (){
                    getPage(current-1)
                }
            )

            $("#btnNext").click(
                function (){
                    getPage(current+1)
                }
            )

            $("#btnPage").click(
                function (){
                    getPage($("#pageNum").val())
                }
            )


            //顾客分页
            let pages_user = 1
            let current_user = 0
            let users = null

            function setUserBtn(){
                $(".btnUserDetail").each(function () {
                    $(this).click(
                        function () {
                            window.localStorage.setItem("user", $(this).attr("value"))
                            window.location.href = "/backend/adminMainUserDetails.html"
                        }
                    )
                })
            }

            function getUserPage(pageNum){

                if(pageNum<=0||pageNum>pages_user){
                    return
                }

                let table = $("#userTable")
                table.empty()
                users = null

                $.ajax({
                        url: "/user/page",
                        type: "post",
                        data: JSON.stringify({
                            "pageNum": pageNum
                        }),
                        contentType: "application/json",
                        dataType: "json",
                        success: function (data) {
                            let r = data;
                            if (r.code === 1) {


                                pages_user = r.data.pages
                                $("#userPageNum").attr("max", pages_user)

                                current_user = r.data.current
                                if(pages_user<=0){
                                    current_user=0
                                }

                                $("#userPageNum").val(current_user)

                                users = r.data.records
                                if(current_user<=1){
                                    $("#btnLastUser").parent("li").addClass("disabled")
                                }
                                else{
                                    $("#btnLastUser").parent("li").removeClass("disabled")
                                }

                                if(current_user>=pages_user){
                                    $("#btnNextUser").parent("li").addClass("disabled")
                                }
                                else{
                                    $("#btnNextUser").parent("li").removeClass("disabled")
                                }

                                table.append(
                                    "<tr>"+
                                    "<td><label>--<label/></td>"+
                                    "<td><label>游客<label/></td>"+
                                    "<td><label>--<label/></td>"+
                                    "<td><label>--<label/></td>"+
                                    "<td><label>--<label/></td>"+
                                    "<td><label>--<label/></td>"+
                                    "<td>" +
                                    "<button class='btnUserDetail btn-info' value='guest'>查看游客画像</button>" +
                                    "</td>"+
                                    "</tr>"
                                )

                                for (let i = 0; i < users.length; i++) {
                                    let u = users[i]

                                    table.append(
                                        "<tr>"+
                                        "<td><label>" + u.id + "<label/></td>"+
                                        "<td><label>" + u.name + "<label/></td>"+
                                        "<td><label>" + (u.sex==0?"男":"女") + "<label/></td>"+
                                        "<td><label>" + u.address + "<label/></td>"+
                                        "<td><label>" + u.email + "<label/></td>"+
                                        "<td><label>" + u.lastlogin + "<label/></td>"+
                                        "<td>" +
                                        "<button class='btnUserDetail btn-info' value='" + u.id + "'>查看用户画像</button>" +
                                        "</td>"+
                                        "</tr>"
                                    )
                                }

                                setUserBtn()

                                $("#labelPageUser").text("共 "+pages_user+" 页，当前第 "+current_user+" 页")
                            } else {
                                alert(r.msg)
                            }
                        }
                    }
                )
            }

            $("#btnShowUser").click(
                function (){
                    $(".headMenu").find("li").removeClass("active")
                    $(this).parent().addClass("active")
                    if(pages_user==0){
                        pages_user=1
                    }
                    getUserPage(1)
                    $("#infoBox").hide()
                    $("#sellerBox").hide()
                    $("#createSeller").hide()
                    $("#userBox").show()
                    $("#searchBox").hide()
                }
            )

            $("#btnLastUser").click(
                function (){
                    getUserPage(current_user-1)
                }
            )

            $("#btnNextUser").click(
                function (){
                    getUserPage(current_user+1)
                }
            )

            $("#btnPageUser").click(
                function (){
                    getUserPage($("#userPageNum").val())
                }
            )

            $("#btnShowTime").click(
                function (){
                    window.location.href = "/backend/adminMainTime.html"
                }
            )

            $("#btnInfo").click(
                function (){
                    $(".headMenu").find("li").removeClass("active")
                    $(this).parent().addClass("active")
                    $("#infoBox").show()
                    $("#sellerBox").hide()
                    $("#createSeller").hide()
                    $("#userBox").hide()
                    $("#searchBox").hide()
                }
            )

            $("#btnSearch").click(
                function (){
                    $(".headMenu").find("li").removeClass("active")
                    $(this).parent().addClass("active")
                    $("#infoBox").hide()
                    $("#sellerBox").hide()
                    $("#createSeller").hide()
                    $("#userBox").hide()
                    $("#searchBox").show()
                }
            )

            $("#btnSearchUser").click(
                function (){
                    $.ajax({
                            url: "/user/infoForAdmin",
                            type: "post",
                            data: JSON.stringify({
                                "id":$("#searchId").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    let item = r.data

                                    let table = $("#searchTable")
                                    table.empty()

                                    table.append(
                                        "<tr>" +
                                        "<th>类型</th>"+
                                        "<td>顾客</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>id</th>"+
                                        "<td>" + item.id + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>姓名</th>"+
                                        "<td>" + item.name + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>email</th>"+
                                        "<td>" + item.email + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>地址</th>"+
                                        "<td>" + item.address + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>性别</th>"+
                                        "<td>" + (item.sex==0?"男":"女") + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>上次登录</th>"+
                                        "<td>" + item.lastlogin + "</td>"+
                                        "</tr>"
                                    )
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("#btnSearchSeller").click(
                function (){
                    $.ajax({
                            url: "/seller/search",
                            type: "post",
                            data: JSON.stringify({
                                "id":$("#searchId").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    let item = r.data

                                    let table = $("#searchTable")
                                    table.empty()

                                    table.append(
                                        "<tr>" +
                                        "<th>类型</th>"+
                                        "<td>销售人员</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>id</th>"+
                                        "<td>" + item.id + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>姓名</th>"+
                                        "<td>" + item.name + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>地址</th>"+
                                        "<td>" + item.address + "</td>"+
                                        "</tr>"
                                    )
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("#btnSearchCart").click(
                function (){
                    if(!reg.test($("#searchId").val())){
                        alert("购物车id应为数字！")
                        return
                    }
                    $.ajax({
                            url: "/cart/search",
                            type: "post",
                            data: JSON.stringify({
                                "id":$("#searchId").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    let item = r.data

                                    let table = $("#searchTable")
                                    table.empty()

                                    table.append(
                                        "<tr>" +
                                        "<th>类型</th>"+
                                        "<td>购物车</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>id</th>"+
                                        "<td>" + item.id + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>商品id</th>"+
                                        "<td>" + item.goodsid + "</td>"+
                                        "</tr>"+
                                        "<th>顾客id</th>"+
                                        "<td>" + item.userid + "</td>"+
                                        "</tr>"+
                                        "<th>商品名</th>"+
                                        "<td>" + item.name + "</td>"+
                                        "</tr>"+
                                        "<th>单价</th>"+
                                        "<td>" + (item.price/100.0).toFixed(2) + "￥</td>"+
                                        "</tr>"+
                                        "<th>数量</th>"+
                                        "<td>" + item.count+ "</td>"+
                                        "</tr>"
                                    )
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("#btnSearchOrder").click(
                function (){
                    if(!reg.test($("#searchId").val())){
                        alert("订单id应为数字！")
                        return
                    }
                    $.ajax({
                            url: "/order/search",
                            type: "post",
                            data: JSON.stringify({
                                "id":$("#searchId").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    let item = r.data

                                    let stat = "未付款"

                                    if(item.stat==1){
                                        stat = "已付款未发货"
                                    }
                                    else if(item.stat==2){
                                        stat = "已发货"
                                    }
                                    else if(item.stat==3){
                                        stat = "申诉中"
                                    }

                                    let table = $("#searchTable")
                                    table.empty()

                                    table.append(
                                        "<tr>" +
                                        "<th>类型</th>"+
                                        "<td>订单</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>id</th>"+
                                        "<td>" + item.id + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>商品id</th>"+
                                        "<td>" + item.goodsid + "</td>"+
                                        "</tr>"+
                                        "<th>顾客id</th>"+
                                        "<td>" + item.userid + "</td>"+
                                        "</tr>"+
                                        "<th>商品名</th>"+
                                        "<td>" + item.name + "</td>"+
                                        "</tr>"+
                                        "<th>单价</th>"+
                                        "<td>" + (item.price/100.0).toFixed(2) + "￥</td>"+
                                        "</tr>"+
                                        "<th>数量</th>"+
                                        "<td>" + item.count+ "</td>"+
                                        "</tr>"+
                                        "<th>地址</th>"+
                                        "<td>" + item.address+ "</td>"+
                                        "</tr>"+
                                        "<th>email</th>"+
                                        "<td>" + item.email + "</td>"+
                                        "</tr>"+
                                        "<th>状态</th>"+
                                        "<td>" + stat + "</td>"+
                                        "</tr>"
                                    )
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("#btnSearchGoods").click(
                function (){
                    $.ajax({
                            url: "/goods/search",
                            type: "post",
                            data: JSON.stringify({
                                "id":$("#searchId").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    let item = r.data

                                    let table = $("#searchTable")
                                    table.empty()

                                    table.append(
                                        "<tr>" +
                                        "<th>类型</th>"+
                                        "<td>商品</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>id</th>"+
                                        "<td>" + item.id + "</td>"+
                                        "</tr>"+
                                        "<tr>" +
                                        "<th>销售id</th>"+
                                        "<td>" + item.seller + "</td>"+
                                        "</tr>"+
                                        "<th>商品名</th>"+
                                        "<td>" + item.name + "</td>"+
                                        "</tr>"+
                                        "<th>单价</th>"+
                                        "<td>" + (item.price/100.0).toFixed(2) + "￥</td>"+
                                        "</tr>"+
                                        "<th>库存</th>"+
                                        "<td>" + item.count+ "</td>"+
                                        "</tr>"+
                                        "<th>未处理订单数</th>"+
                                        "<td>" + item.unsend+ "</td>"+
                                        "</tr>"+
                                        "<th>销量</th>"+
                                        "<td>" + item.sold+ "</td>"+
                                        "</tr>"+
                                        "<th>介绍</th>"+
                                        "<td>" + item.intro+ "</td>"+
                                        "</tr>"+
                                        "<th>图片</th>"+
                                        "<td><img src='" + "/photo/" + item.photo +
                                        "'></td>"+
                                        "</tr>"
                                    )
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )

            $("input").attr("autocomplete", "off")
        })
    </script>
</head>
<body>

    <ul class="nav nav-tabs headMenu">
        <li role="presentation" class="active"><a id="btnInfo">管理员信息</a></li>
        <li role="presentation"><a id="btnShow">查看销售人员</a></li>
        <li role="presentation"><a id="btnShowNew">新增销售人员</a></li>
        <li role="presentation"><a id="btnShowUser">查看顾客</a></li>
        <li role="presentation"><a id="btnSearch">查询</a></li>
        <li role="presentation"><a id="btnShowTime">操作记录</a></li>
        <li><a id="btnLogout" class="text-danger">登出</a></li>
    </ul>

    <div class="dropdown-header">
        <h4 id="count"></h4>
        <button id="btnCount" class="btn-sm btn-default">刷新</button>
        <hr>
    </div>

    <div id="infoBox" class="table-responsive">
        <div class="page-header">
            <h3>
                管理员信息
            </h3>
        </div>
        <table class="table table-bordered table-striped">
            <tr>
                <th>id</th>
                <td>
                    <label id="id"></label>
                </td>
            </tr>
            <tr>
                <th>姓名</th>
                <td>
                    <input id="name" type="text">
                </td>
            </tr>
            <tr>
                <th>地址</th>
                <td>
                    <input id="address" type="text">
                </td>
            </tr>
            <tr>
                <th>操作</th>
                <td>
                    <button id="btnUpdate" class="btn-primary">修改</button>
                </td>
            </tr>
        </table>
    </div>


    <div id="createSeller" class="table-responsive" hidden>
        <div class="page-header">
            <h3>
                新建销售人员
            </h3>
        </div>
        <table class="table table-bordered table-striped">
            <tr>
                <th>id</th>
                <td>
                    <input id="sellerId" type="text">
                </td>
            </tr>
            <tr>
                <th>密码</th>
                <td>
                    <input id="sellerPwd" type="text">
                </td>
            </tr>
            <tr>
                <th>姓名</th>
                <td>
                    <input id="sellerName" type="text">
                </td>
            </tr>
            <tr>
                <th>地址</th>
                <td>
                    <input id="sellerAddress" type="text">
                </td>
            </tr>
            <tr>
                <th>操作</th>
                <td>
                    <button id="btnNewSeller" class="btn-primary">新增销售人员</button>
                </td>
            </tr>
        </table>
    </div>

    <div id="sellerBox" class="table-responsive" hidden>
        <div class="page-header">
            <h3>
                所有销售人员
            </h3>
        </div>
        <table class="table table-bordered table-striped">
            <thead>
            <tr>
                <td>id</td>
                <td>密码</td>
                <td>商店名</td>
                <td>地址</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody id="sellerTable">

            </tbody>
        </table>
        <nav aria-label="Page navigation">
            <ul class="pagination" id="sellerPage">
                <li>
                    <a aria-label="Previous" id="btnLast">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li>
                    <a aria-label="Next" id="btnNext">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
                <li style="display: inline">
                    <label for="pageNum" id="labelPage"></label>
                    <input type="number" id="pageNum" min="0" max="1" value="1">
                    <button type="button" class="btn btn-primary btn-xs" id="btnPage">跳转</button>
                </li>
            </ul>

        </nav>
    </div>

    <div id="userBox" class="table-responsive" hidden>
        <div class="page-header">
            <h3>
                所有顾客
            </h3>
        </div>
        <table class="table table-bordered table-striped">
            <thead>
            <tr>
                <td>电话</td>
                <td>姓名</td>
                <td>性别</td>
                <td>地址</td>
                <td>邮箱</td>
                <td>上次登录时间</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody id="userTable">

            </tbody>
        </table>
        <nav aria-label="Page navigation">
            <ul class="pagination" id="userPage">
                <li>
                    <a aria-label="Previous" id="btnLastUser">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li>
                    <a aria-label="Next" id="btnNextUser">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
                <li style="display: inline">
                    <label for="pageNum" id="userLabelPage"></label>
                    <input type="number" id="userPageNum" min="0" max="1" value="1">
                    <button type="button" class="btn btn-primary btn-xs" id="btnPageUser">跳转</button>
                </li>
            </ul>
        </nav>
    </div>

    <div id="searchBox" class="table-responsive" hidden>
        <div class="page-header">
            <h3>
                查询
            </h3>
        </div>
        <div class="btn-toolbar">
            <div class="btn-group">
                <button id="btnSearchUser" class="btn btn-default">查看用户</button>
                <button id="btnSearchSeller" class="btn btn-default">查看销售人员</button>
                <button id="btnSearchGoods" class="btn btn-default">查看商品</button>
                <button id="btnSearchOrder" class="btn btn-default">查看订单</button>
                <button id="btnSearchCart" class="btn btn-default">查看购物车</button>
            </div>
            <div class="input-group" style="width: 20%">
                <span class="input-group-addon">id</span>
                <input class="form-control" id="searchId" type="text" value="" placeholder="输入完整的id">
            </div>
        </div>
        <hr>
        <table class="table table-bordered table-striped">
            <tbody id="searchTable">

            </tbody>
        </table>
    </div>
</body>
</html>